//
// Created by macbookpro on 2024/4/12.
//


#ifndef TESTDESIGNPATTERNSSTRATEGY_MALLARDDUCK_H
#define TESTDESIGNPATTERNSSTRATEGY_MALLARDDUCK_H

#include "Duck.h"
#include "Quack.h"
#include "FlyWithWings.h"
#include <iostream>

class MallardDuck : public Duck{
public:
    //子类继承父类的构造
    //不能直接从初始化列表初始化基类成员，应该使用父类的构造函数
    explicit MallardDuck(std::unique_ptr<FlyWithWings>&& flyWithWings ={},
                         std::unique_ptr<Quack>&& quack={})
                         : Duck(std::move(flyWithWings), std::move(quack)){

    }

    void display() const override{
        std::cout<<"I'm a real Mallard duck"<<std::endl;
    }

};


#endif //TESTDESIGNPATTERNSSTRATEGY_MALLARDDUCK_H
